package com.mall.util.distributed.raft.rpc.message;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@Accessors(chain = true)
@Schema(description = "日志条目")
public class LogEntry implements Serializable {
    @Schema(description = "当前日志对应的任期")
    private long term;

    @Schema(description = "当前日志下标索引")
    private long index;

    @Schema(description = "当前日志所对应的执行命令")
    private Command command;

    @Data
    @Accessors(chain = true)
    @Schema(description = "日志条目中的命令")
    public static class Command {
        private String key;

        private String value;
    }
}
